﻿/**
 * ...
 * @author	Kliment
 * @version	1.2.5
 */
class kliment.utils._Type {
	public static var STRING:String = 'string';
	public static var NUMBER:String = 'number';
	public static var BOOLEAN:String = 'boolean';
	public static var ARRAY:Function = Array;
	public static var BUTTON:Function = Button;
	public static var TEXT_FIELD:Function = TextField;
	public static var OBJECT:String = 'object';
	public static var FUNCTION:String = 'function';
	public static var MOVIE_CLIP:String = 'movieclip';
	public static var UNDEFINED:String = 'undefined';
	public static var NULL:String = 'null';
	
	public static function isString(value):Boolean {
		if (typeof(value) == STRING)
			return true;
		return false;
	}
	
	public static function isNumber(value):Boolean {
		if (typeof(value) == NUMBER)
			return true;
		return false;
	}
	
	public static function isBoolean(value):Boolean {
		if (typeof(value) == BOOLEAN)
			return true;
		return false;
	}
	
	public static function isArray(value):Boolean {
		if (value instanceof ARRAY)
			return true;
		return false;
	}
	
	public static function isObject(value):Boolean {
		if (typeof(value) == OBJECT)
			return true;
		return false;
	}
	
	public static function isFunction(value):Boolean {
		if (typeof(value) == FUNCTION)
			return true;
		return false;
	}
	
	public static function isMovieClip(value):Boolean {
		if (typeof(value) == MOVIE_CLIP && value._target)
			return true;
		return false;
	}
	
	public static function isTextField(value):Boolean {
		if (value instanceof TEXT_FIELD)
			return true;
		return false;
	}
	
	public static function isButton(value):Boolean {
		if (value instanceof BUTTON)
			return true;
		return false;
	}
	
	public static function isDisplayObject(value):Boolean {
		if (isMovieClip(value) || isTextField(value) || isButton(value))
			return true;
		return false;
	}
	
	public static function isUndefined(value):Boolean {
		if (typeof(value) == UNDEFINED)
			return true;
		return false;
	}
	
	public static function StringToBoolean(value:String):Boolean {
		return Boolean(Number(value));
	}
}